#include <iostream>

using namespace std;

bool isPalindromes(const string&);

int main()
{
  string s1("mom");
  string s2("dad");
  string s3("0110");
  string s4("01210");
  string s5("012310");
  string s6("Mom");
  string s7("");
  string s8("n");

  cout << "isPalindromes(s1) = " << isPalindromes(s1) << endl;
  cout << "isPalindromes(s2) = " << isPalindromes(s2) << endl;
  cout << "isPalindromes(s3) = " << isPalindromes(s3) << endl;
  cout << "isPalindromes(s4) = " << isPalindromes(s4) << endl;
  cout << "isPalindromes(s5) = " << isPalindromes(s5) << endl;
  cout << "isPalindromes(s6) = " << isPalindromes(s6) << endl;
  cout << "isPalindromes(s7) = " << isPalindromes(s7) << endl;
  cout << "isPalindromes(s8) = " << isPalindromes(s8) << endl;
  cout << "************************" << endl << endl << endl;
  cout << "Please input your string: ";
  string s;
  getline(cin, s);
  cout << "Input string = " << s << endl;
  cout << "isPalindromes(s) = " << isPalindromes(s) << endl;

  return 0;
}

bool isPalindromes(const string &myString)
{
  cout << "========================" << endl;
  cout << "myString = " << myString << endl;
  cout << "myString.size() / 2 = " << myString.size() / 2 << endl;
  // size 5, size / 2 = 2
  // size 4, size / 2 = 2
  // "a", size 1, size / 2 = 0
  // "aa", size 2, size / 2 = 1
  // "aaa", size 3, size / 2 = 1
  for(int i = 0; i < (myString.size() / 2); i++)
  {
    cout << myString[i] << ", " << myString[myString.size() - i - 1] << endl;
    if(myString[i] != myString[myString.size() - i - 1])
    {
      return false;
    }
  }
  return true;
}
